package saxion.security.android;

import android.app.Activity;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.util.Log;


public class Main extends Activity {

	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
	    super.onCreate(savedInstanceState);
	    
	    PreferenceManager.setDefaultValues(this, R.layout.preferences, false);
	    
        SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);

        //the main activity
        Intent mainIntent = new Intent(this, SecurityAndroidActivity.class);
        //the install activity
        Intent installIntent = new Intent(this, InstallActivity.class);
        
        if(prefs.getBoolean("install", true) == true){
        	Log.v("hallo", "test");
        	startActivity(installIntent);
        }else{
        	startActivity(mainIntent);
        }
        
        this.finish();
	}

}
